package com.regentsoft.cloudback.operateAdmin.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.regentsoft.cloudback.base.Pager;
import com.regentsoft.cloudback.operateAdmin.dao.SysAdminMapper;
import com.regentsoft.cloudback.operateAdmin.entity.SysAdmin;
import com.regentsoft.cloudback.operateAdmin.service.SysAdminService;
/**
 * 
 * @author czd
 *
 * @date 2017年11月25日
 *
 * @version 1.0
 */
@Service
public class SysAdminServiceImpl implements SysAdminService{
	@Autowired
	private SysAdminMapper mapper;
	@Override
	public SysAdmin findById(Long pk) throws Exception {
		return mapper.findById(pk);
	}

	@Override
	public List<SysAdmin> findList(SysAdmin obj) throws Exception {
		return mapper.findList(obj);
	}

	@Override
	public Pager findPageList(SysAdmin obj, Integer pageNumber, Integer pageSize) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int add(SysAdmin obj) throws Exception {
		return mapper.add(obj);
	}

	@Override
	public int update(SysAdmin obj) throws Exception {
		return mapper.update(obj);
	}

	@Override
	public int delete(Long pk) throws Exception {
		return mapper.deleteById(pk);
	}

	@Override
	public int getTotalCount(Map<String, Object> map) throws Exception {
		return mapper.getTotalCount(map);
	}

	@Override
	public List<SysAdmin> queryByPage(Map<String, Object> map) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public SysAdmin findByName(String name) {
		Map<String,Object> map = new HashMap<>();
		map.put("name", name);
		return mapper.findByName(map);
	}

}
